<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <form action="" method="post">
            <div>
                <input type="text" v-model="uname"/>
            </div>
            <div>
                <input type="password" v-model="pwd" @keyup.enter="handleSubmit"/>
            </div>
            <div @click="handleSubmit">
                <input type="button" @click="handleSubmit" value="提交">
            </div>
        </form>
    </div> 
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.prod.js"></script>
<script>
    const vm = Vue.createApp({
        data(){ return {
            uname:'',
            pwd:''
        }},
        methods: {
            handleSubmit:function(){
                console.log(this.uname,this.pwd);
            }
        }
    }).mount('#app');
</script>

</body>
</html>
